/*
* 排行页面 api数据抓取
* */
import jsonp from 'common/js/jsonp'  // 引入封装好的jsonp
import {commonParams,options} from './config' // 引入封装的 jsonp 所需的参数封装js文件

// 请求排行榜列表数据
export function getTopList () {
  const url = 'https://c.y.qq.com/v8/fcg-bin/fcg_myqq_toplist.fcg';
  const data = Object.assign({},commonParams,{
    g_tk: 5381,
    platform: 'h5',
    needNewCode: '1',
    _: + new Date()//
  });
  return jsonp(url, data, options)
}
// 请求排行榜列表详情数据
export function getMusicList (topid) {
  const url = 'https://c.y.qq.com/v8/fcg-bin/fcg_v8_toplist_cp.fcg';
  const data = Object.assign({},commonParams,{
    topid,
    type: 'top',
    page: 'detail',
    tpl: 3,
    platform: 'h5',
    needNewCode: 1,
  });
  return jsonp(url,data,options)
}
